<template>
  <div
    ref="myDiv"
    class="radar-echart"
  >

  </div>
</template>

<script>
var echarts = require('echarts/lib/echarts') // 引入echarts主模块
require('echarts/lib/chart/radar') // 引入雷达图
// 引入提示框和标题组件
require('echarts/lib/component/tooltip')
require('echarts/lib/component/title')
// import * as echarts from 'echarts';
export default {
  mounted () {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(this.$refs.myDiv);
    var option = {
      title: {
        text: '基础雷达图'
      },
      radar: {
        // shape: 'circle',
        indicator: [
          { name: '工作效率', max: 100 },
          { name: '考勤', max: 100 },
          { name: '积极性', max: 100 },
          { name: '帮助同事', max: 100 },
          { name: '自主学习', max: 100 },
          { name: '正确率', max: 100 }
        ]
      },
      series: [{
        name: '预算 vs 开销（Budget vs spending）',
        type: 'radar',
        data: [
          {
            value: [80, 70, 100, 60, 100, 60],
            name: '张三'
          },
          {
            value: [50, 50, 50, 50, 50, 50],
            name: '李四'
          }
        ]
      }]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  }
}
</script>

<style>
.radar-echart {
  width: 600px;
  height: 400px;
}
</style>